How to fix Xamarin Android: Mono Shared MonoRuntime is not supported ~ AndroidBugFix

您所在的位置:网站首页 libvlcsharp Android How to fix Xamarin Android: Mono Shared MonoRuntime is not supported ~ AndroidBugFix

How to fix Xamarin Android: Mono Shared MonoRuntime is not supported ~ AndroidBugFix

2023-04-04 12:12| 来源: 网络整理| 查看: 265

How to fix Xamarin Android: Mono Shared MonoRuntime is not supported

 September 15, 2022     monodevelop, xamarin, xamarin.android, xamarin.forms, xamarin.ios     No comments   

Issue

When I deploy (or archive) my Xamarin.Android application and attempt to use the .APK file in a UI test I am met with this error. My configuration is exactly how it should be for a release build. (PLEASE READ TO THE END)

System.Exception : Mono Shared Runtime is not supported. This can be resolved by changing the project configuration or using a Release build. Stack Trace ApkFile.EnsureNoSharedRuntime() AndroidAppInitializer.PrepareApkFiles(IAndroidAppConfiguration appConfiguration, ArtifactFolder artifactFolder) AndroidApp.ctor(IAndroidAppConfiguration appConfiguration, IExecutor executor) AndroidAppConfigurator.StartApp(AppDataMode appDataMode) AppInitializer.StartApp(Platform platform) Tests.BeforeEachTest() AndroidManifest.xml true portable true bin\Release prompt 4 true false false false true false true

This is ridiculous I have seen questions about this going up to FIVE years back and many unanswered. If someone knows a fix to this please let's help me and everyone else having this issue.

I literally created a brand new project with VS2022 and even on the release config. this error still shows on both emulated and physical devices.

Update: When the project is built and signed with Azure Devops the .APK file works on UITest. I am convinced this is a Visual Studio APK deployment problem.

Solution

We've had similar problems before, you can try the following methods:

1.in release mode,please make sure you uncheck use Fast Deployment(debug mode only);

2.make sure update your nuget to the latest one,the old Nuget had this issue;

3.If the problem persists,you can try the following workaround: set

false

in the configuration you are using with Xamarin.UITest.

4.try to delete obj and bin folders in your app and try again.

Answered By - Jessie Zhang -MSFT

Share This:    Facebook Twitter Google+ Stumble Digg This Answer collected from stackoverflow and tested by AndroidBugFix community admins, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3